<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>属性遍历</title>
	</head>
	<body>
		<p>找出对象 obj 不在原型链上的属性(注意这题测试例子的冒号后面也有一个空格~)<br/>
			1、返回数组，格式为 key: value<br/>
			2、结果数组不要求顺序 <br/>
		</p>
		<script type="text/javascript">
			function iterate(obj) {
				var res=[];
				for( ele in obj){
					if(obj.hasOwnProperty(ele)){
						res.push(ele+": "+obj[ele]);
					}
			   }
				return res;
			}
			var C = function() {this.foo = 'bar'; this.baz = 'bim';}; 
			C.prototype.bop = 'bip'; 
			iterate(new C());
		</script>
	</body>
</html>
